package com.ybkj.o2o.zhuanxian.service.impl;

import com.ybkj.o2o.zhuanxian.entity.OrderStatus;
import com.ybkj.o2o.zhuanxian.mapper.OrderStatusMapper;
import com.ybkj.o2o.zhuanxian.service.OrderStatusService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class DefaultOrderStatusService implements OrderStatusService {

  @Autowired
  private OrderStatusMapper orderStatusMapper;

  @Override
  public int insert(OrderStatus orderStatus) {
    orderStatus.setCreated(new Date());
    orderStatus.setUpdated(new Date());
    return orderStatusMapper.insert(orderStatus);
  }

  @Override
  public List<OrderStatus> findByOrderId(Long orderId) {
    return orderStatusMapper.findByOrderId(orderId);
  }

}
